package ch7design;

import java.util.Set;

class Book {
	private long ID;
	private String details;
	private static Set<Book> books;

	public Book(long iD, String details) {
	}

	public static void addBook(long iD, String details) {
		books.add(new Book(iD, details));
	}

	public void update() {
	}

	public static void delete(Book b) {
		books.remove(b);
	}

	public static Book find(long id) {
		for (Book b : books)
			if (b.ID == id)
				return b;
		return null;
	}
}

class OnlineUser {
	private long ID;
	private String details;
	private int accountType;
	private static Set<OnlineUser> OnlineUsers;

	public Book searchLibrary(long id) {
		return Book.find(id);
	}

	public void renewMembership() {
	}

	public static OnlineUser find(long ID) {
		for (OnlineUser u : OnlineUsers) {
			if (u.ID == ID)
				return u;
		}
		return null;
	}

	public static void addOnlineUser(long ID, String details, int accountType) {
		OnlineUsers.add(new OnlineUser(ID, details, accountType));
	}

	public OnlineUser(long iD, String details, int accountType) {
	}
}

public class OnlineReaderSystem {
	private Book b;
	private OnlineUser u;

	public OnlineReaderSystem(Book b, OnlineUser u) {
	}

	public void listenRequest() {
	}

	public Book searchBook(long ID) {
		return Book.find(ID);
	}

	public OnlineUser searchOnlineUser(long ID) {
		return OnlineUser.find(ID);
	}

	public void display() {
	}
}